﻿


CREATE PROCEDURE dbo.sec__CheckGLAccess
AS
--IF NOT dbo.UserName() IN (SELECT Value FROM dbo.RegistryValues('GL_Admins')) BEGIN
IF dbo.UserGroup() <> 'Admin' BEGIN
	ROLLBACK TRAN
	DECLARE @Text varchar(8000)
	SET @Text = dbo.sprintf1('User $0 in group $1 can''t change rules.',dbo.UserName(),dbo.UserGroup())
	RAISERROR(@Text,16,1)
	RETURN -1
END

RETURN 0


